package com.software.loginregister.util;

/***
 * 防止重复点击的工具类
 */
public class ClickUtils {
    private static final int MIN_CLICK_DELAY_TIME = 1000; // 两次点击间隔不能少于1000毫秒
    private static long lastClickTime;

    public static boolean isFastClick() {
        boolean flag = true;
        long currentClickTime = System.currentTimeMillis();
        if ((currentClickTime - lastClickTime) >= MIN_CLICK_DELAY_TIME) {
            flag = false;
        }
        lastClickTime = currentClickTime;
        return flag;
    }
}
